<template>
</template>

<script>
	export default {
		data() {
			return {
				loginForm: {
					username: "admin",
					password: "admin123",
					code: "",
					uuid: ''
				}
			}
		},
		created() {
			// const table = this.$route.query.table
			// if (table == undefined || table == '' || table == null){
			// 	this.$tab.navigateTo('/pages/module/wtc/index')
			// }else{
			// 	this.$tab.navigateTo('/pages/module/wtc/index?table=' + table)
			// }
			this.pwdLogin()
		},
		methods: {
			// 密码登录
			async pwdLogin() {
				this.$store.dispatch('Login', this.loginForm).then(() => {
					this.$modal.closeLoading()
					this.loginSuccess()
				})
			},
			// 登录成功后，处理函数
			loginSuccess(result) {
				// 设置用户信息
				this.$store.dispatch('GetInfo').then(res => {
					const table = this.$route.query.table
					if (table == undefined || table == '' || table == null) {
						this.$tab.reLaunch('/pages/module/wtc/index')
					} else {
						this.$tab.reLaunch('/pages/module/wtc/index?table=' + table)
					}
					// this.$tab.reLaunch('/pages/module/wtc/index?table=21')
				})
			},
		}
	}
</script>

<style>
</style>
